<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>

<!DOCTYPE html>
<html>
  <head>
    <title>已经审核过的照片</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Bootstrap -->
    <link rel="stylesheet" href="http://cdn.bootcss.com/twitter-bootstrap/3.1.1/css/bootstrap.min.css">
    <script src="http://cdn.bootcss.com/jquery/2.0.3/jquery.min.js"></script>
	<script src="http://cdn.bootcss.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
    
    <script type="text/javascript">
    
    document.addEventListener('DOMContentLoaded',function(){
        
    	var title = "<p>操作成功！</p>";  
        var options = {  
            "placement" : "bottom", // 在链接下方显示tooltip  
            "trigger" : "hover",    // 显示方式  
            "title" : title,        // tooltip中内容  
            "html" : "true",   // 如果为true，title可以为html代码
        };
        
        $("div.progress").hide();
    	
        },
	false);
    
        
       
    </script>
    
    <script type="text/javascript">
    function pass(id) {
    	
    	$("#btn-pass-"+id).addClass("disabled");
    	$("#div-progress-"+id).show();
    	
    	$.ajax({
			url: "./photographer_passexamine",
			dataType: "json",
			data: "photoId=" + id,
			async: false,
			success: function(data) {
				//$("#btn-pass-"+id).tooltip(options);
				//$("#btn-pass-"+id).tooltip("show");
		    	$("#btn-pass-"+id).addClass("disabled");
		    	$("#div-progress-"+id).hide();
		    	alert("操作成功");
			},
			error: function(err) {
				$("#div-progress-"+id).hide();
				$("#btn-pass-"+id).removeClass("disabled");
				alert("抱歉，我们遇到一点问题，请稍后再试。");
			}
		});
    	
    }
    function dele(id) {
    	
    	$.ajax({
			url: "./photographer_delete",
			dataType: "json",
			data: "photoId=" + id,
			async: false,
			success: function(data) {
				/* for(var i=0; i<data.photos.length; i++) {
					$("#Gallery").append("<li><a href=\""+data.photos[i].photoUrl+"\"><img src=\""+data.photos[i].photoUrl+"\" alt=\""+data.photos[i].photoTitle+"#"+data.photos[i].photoDesc+"\" /></a></li>");
				}
				$("#lastId").val(data.lastId); */
				$("#thumb-"+id).hide();
		    	alert("删除成功");
			},
			error: function(err) {
				alert("抱歉，我们遇到一点问题，请稍后再试。");
			}
		});
    }
    </script>
  </head>
  <body>
<div class="container">
<h2>已经审核过的照片</h2>



<s:iterator value="photoPage.list">
	<div class="row">
    <s:iterator value="top" id="photo">
        <div class="col-md-3" id="thumb-<s:property value='#photo.id' />">
	    <div class="thumbnail">
	      <img src='<s:property value="#photo.photoUrl" />' class="img-responsive">
	      <div id="div-progress-<s:property value='#photo.id' />" class="progress progress-striped active">
			<div class="progress-bar"  role="progressbar" aria-valuenow="45" aria-valuemin="0" aria-valuemax="100" style="width: 100%">
			<span class="sr-only">45% Complete</span>
			</div>
		  </div>
	      <div class="caption">
	        <h3><s:property value="#photo.photoTitle" /></h3>
	        <p><s:property value="#photo.photoDesc" /></p>
	        <p><a href="#" id="btn-dele-<s:property value='#photo.id' />" class="btn btn-default" role="button" onclick="dele(<s:property value='#photo.id' />)">删除</a></p>
	      </div>
	    </div>
	    </div>
    </s:iterator>
    </div>
</s:iterator>






<ul class="pagination">
  <s:if test="photoPage.hasPreviousPage">
  <li><a href="photographer_unexamine?photoPage.currentPage=1">&laquo;</a></li>
  </s:if>
  <s:else>
  <li class="disabled"><a href="#">&laquo;</a></li>
  </s:else>
  
  <s:iterator var="i" begin="1" end="photoPage.totalPage" step="1">
  <s:if test="photoPage.currentPage==#i">
  <li class="active"><a href="#"><s:property value="#i"/></a></li>
  </s:if>
  <s:else>
  <li><a href="photographer_unexamine?photoPage.currentPage=<s:property value='#i'/>"><s:property value="#i"/></a></li>
  </s:else>
  </s:iterator>
  
  <s:if test="photoPage.hasNextPage">
  <li><a href="photographer_unexamine?photoPage.currentPage=<s:property value='photoPage.totalPage' />">&raquo;</a></li>
  </s:if>
  <s:else>
  <li class="disabled"><a href="#">&raquo;</a></li>
  </s:else>
</ul>



</div>

<div class="tooltip">
  <div class="tooltip-inner">
    Tooltip!
  </div>
  <div class="tooltip-arrow"></div>
</div>

</body>
</html>